package com.sgzn.sgpay.service.tcp.receive.handler;

import com.sgzn.sgpay.service.tcp.receive.TcpReceiveCallHandlerTemplate;
import com.sgzn.sgpay.service.tcp.receive.modle.TcpReceiveCallRequest;
import lombok.Getter;

/**
 * 获取二维码链接(终端发起) 处理器
 * @author huangsenguang
 * @version Id: TcpObtainTwoDimensionCodeHandler.java, v 0.1 2018/7/30 11:55 huangsenguang Exp $$
 */
public class TcpObtainTwoDimensionCodeHandler extends TcpReceiveCallHandlerTemplate<String> {
    /**
     * 协议总字符数
     */
    @Getter
    private final int protocolLength = 14;

    @Override
    public String callInner(TcpReceiveCallRequest request) {
        return request.getData();
    }

    @Override
    protected void handleAfter(TcpReceiveCallRequest request, String result) {
        //data预留1个字节
    }

    @Override
    protected int getProtocolLength(TcpReceiveCallRequest request) {
        return this.protocolLength;
    }
}

